package com.leo.oplayer.service;

import java.util.TimerTask;

import android.app.NotificationManager;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.Log;

public class NoticeTask extends TimerTask{
	
//	private Context context;
//	
//	private ContactService contactService;
//	
//	private NotificationManager nM;
	
	private Handler handler; 

	
//	public NoticeTask(Context context,NotificationManager nM,Handler handler){
//		this.context = context;
//		this.contactService = new ContactService(new DBService(context));
//		this.nM = nM;
//		this.handler = handler;
//	}
	
	public NoticeTask(Handler handler){
//		this.context = context;
//		this.contactService = new ContactService(new DBService(context));
//		this.nM = nM;
		this.handler = handler;
	}

	@Override
	public void run() {
		Log.i("TASK", "run task####");
		
//		Message message = new Message();
//		message.what = 1;
//		handler.sendMessage(message);     
		handler.sendEmptyMessage(1);

// int spanDay = Integer.valueOf(ConfigCenter.getValue(context,
// Constancts.KEY_MAX_NOCONTACT_DAY, "7"));
//		List<String> persons = contactService.checkLongNoContacts(spanDay);
//		if(!persons.isEmpty()){
//			StringBuffer sb = new StringBuffer();
//			for(String personId: persons){
//				String name = PersonUtil.findNameById(context, personId);
//				sb.append(name).append(".");
//			}
//			
//			Notification nf = new Notification(R.drawable.icon,"no concat persons:"+sb.toString(),System.currentTimeMillis());
//			nM.notify(0, nf);
//		}
		
	}
	

}
